﻿<Window x:Class="QDChatReader.QDChatWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:p="clr-namespace:QDChatReader.Properties"
        xmlns:local="clr-namespace:QDChatReader"
        mc:Ignorable="d"
        Title="QD Chat" Width="360" MinWidth="300"  
        Loaded="Window_Loaded" 
        Icon="QDChatReader.ico" ShowInTaskbar="False" Top="20" Left="860" MinHeight="400">

    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="DictionaryFlowDocs.xaml"></ResourceDictionary>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>

    <Grid>
        <DataGrid x:Name="chatGridView" ItemsSource="{Binding}" Margin="10,45,10,10" Grid.Row="1" Grid.ColumnSpan="1" AutoGenerateColumns="False" CanUserSortColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" HorizontalGridLinesBrush="White" VerticalGridLinesBrush="White">
            <DataGrid.Columns>
                <DataGridTextColumn Header="{x:Static p:Resources.Main_CTabColDate}" Width="130" Binding="{Binding Date, StringFormat=\{0:dd.MM.yy HH:mm:ss\}}" IsReadOnly="True" CanUserReorder="False" CanUserResize="False" />
                <DataGridTextColumn Header="{x:Static p:Resources.Main_CTabColChat}" Width="1*" MinWidth="200" Binding="{Binding Chat}" IsReadOnly="True" CanUserReorder="False" CanUserResize="False">
                    <DataGridTextColumn.ElementStyle>
                        <Style TargetType="TextBlock">
                            <Setter Property="TextBlock.TextWrapping" Value="Wrap" />
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding Direction}" Value="OUT">
                                    <Setter Property="Background" Value="#FFC7EAFF"></Setter>
                                    <Setter Property="Margin" Value="40,1,1,1" ></Setter>
                                </DataTrigger>
                                <DataTrigger Binding="{Binding Direction}" Value="IN">
                                    <Setter Property="Background" Value="#FFEAEAEA"></Setter>
                                    <Setter Property="Margin" Value="1,1,40,1" ></Setter>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </DataGridTextColumn.ElementStyle>
                </DataGridTextColumn>
            </DataGrid.Columns>
        </DataGrid>
        <Label x:Name="label" Content="{Binding Path=PersonSelected}" HorizontalAlignment="Left" Height="30" Margin="10,10,0,0" VerticalAlignment="Top" Width="310"/>

    </Grid>
</Window>
